
#ifndef ORGANIZEDIALOG_H
#define ORGANIZEDIALOG_H

#include <BLineEdit>
#include <BListWidget>
#include <BButton>
#include <BLabel>
#include <BDialog>
#include "Target.h"

using namespace BWE;

class OrganizeDialog : public BDialog
{
	BOBJECT(OrganizeDialog);
public:
	OrganizeDialog(BWidget* parent = 0);
	~OrganizeDialog();

	void setTarget(Target* target);
	Target* target();

protected:
	BIcon* iconOf(const BObject* object);
	BImage* imageOf(const BObject* object);

protected:
	void slotObjectNameEdited(BObject* object, const BValue& value);
	void slotListWidgetFramed(BObject* object, const BValue& value);
	void slotListItemClicked(BObject* object, const BValue& value);
	void slotNameEditFocused(BObject* object, const BValue& value);

	void slotApplyButtonClicked(BObject* object, const BValue& value);
	void slotCancelButtonClicked(BObject* object, const BValue& value);

protected:
	virtual void showEvent(const BEvent& event);
	virtual void hideEvent(const BEvent& event);

private:
	BHolder<Target>		_target;
	BLineEdit*			_scopeNameEdit;
	BLineEdit*			_objectNameEdit;
	BLabel*				_infoLabel;
	BListWidget*		_listWidget;
	BLineEdit*			_nameEdit;
	BButton*			_applyButton;
	BButton*			_cancelButton;
};

#endif
